package com.wallet.trans.enums;

public enum MpcTransactionStatusEnum {
    SUBMITTED("SUBMITTED", "待授权"),
    SIGNING("SIGNING", "签名中"),
    BROADCASTING("BROADCASTING", "广播中"),
    CONFIRMING("CONFIRMING", "确认中"),
    CANCELLED("CANCELLED", "交易取消"),
    COMPLETED("COMPLETED", "交易成功"),
    FAILED("FAILED", "交易失败"),
    REJECTED("REJECTED", "拒绝");

    private String name;
    private String message;

    MpcTransactionStatusEnum(String name, String message) {
        this.name = name;
        this.message = message;
    }

    public String getName() {
        return name;
    }

    public String getMessage() {
        return message;
    }

    public static String mpcTransactionStatusEnum(String name) {
        for (MpcTransactionStatusEnum c : MpcTransactionStatusEnum.values()) {
            if (c.getName().equals(name)) {
                return c.getMessage();
            }
        }
        return null;
    }
}
